﻿using System;
using UserSystem.Model;

namespace UserSystem.BLL
{
    public class RegUserManage
    {
        public static RegUserToClient RegUser(RegUserFromClient client, out string msg)
        {
            RegUserToClient result;
            if (client == null)
            {
                result = null;
                msg = "注册信息不能为空";
            }
            else
            {
                if (string.IsNullOrEmpty(client.account))
                {
                    result = null;
                    msg = "账号不能为空";
                }
                else
                {
                    if (string.IsNullOrEmpty(client.name))
                    {
                        result = null;
                        msg = "姓名不能为空";
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(client.password))
                        {
                            result = null;
                            msg = "密码不能为空";
                        }
                        else
                        {
                            result = new RegUserToClient();
                            result.userName = "好少年";
                            result.token = "djkfakdfhahgjkasdkfhasgjasfhas90091880";
                            msg = "注册成功。";
                        }
                    }
                }
            }
            return result;
        }
    }
}